package com.travel.api.interceptor

import org.apache.http.Header
import org.slf4j.LoggerFactory
import org.springframework.web.servlet.HandlerInterceptor
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

/**
 * 用户拦截器
 */
class UserInterceptor: HandlerInterceptor {

    val log = LoggerFactory.getLogger(this::class.java)

    override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {

        val url = request.requestURL;

        log.info("[用户拦截器]当前访问url={}", url)
        // TODO 检查用户权限

        return true
    }

}